/**
 * Created by yangzhi on 2019/8/19.
 */
layui.define(['jquery','layer'],function(exports){
    var $ = layui.jquery;
    var layer = layui.layer;
// 设置jQuery Ajax全局的参数
    $.ajaxSetup({
        complete : function(XMLHttpRequest, textStatus) {
            if(XMLHttpRequest.responseJSON.code==401){
                layer.msg(XMLHttpRequest.responseJSON.msg,{time:2000},function () {
                    top.location.href=XMLHttpRequest.responseJSON.data.redirectUrl;
                });
            }
        }
    });
    exports('checkSession', {});
});